<script type="text/javascript">
var ad = null;
<?php
	if (isset ($_SESSION["ad"])){
		$ad = json_encode($_SESSION["ad"]);	
		echo "ad=$ad;";
	}
	
	
?>
</script>
 